package com.sanbi.common.express.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @description: 出库单状态枚举
 * @author: wanpeng
 * @create: 2024-05-29 08:45
 * @Version 1.0
 **/
@AllArgsConstructor
@Getter
public enum CaiNiaoOutboundStatusEnum {
    N("N", "草稿"),
    S("S", "出库中"),
    P("P", "已下架"),
    C("C", "已出库"),
    X("X", "已取消"),
    D("D", "已删除"),
    E("E", "异常");

    /** 编码 */
    private final String code;
    /** 描述 */
    private final String desc;

    public static CaiNiaoOutboundStatusEnum getByCode(String code) {
        for (CaiNiaoOutboundStatusEnum e : CaiNiaoOutboundStatusEnum.values()) {
            if (Objects.equals(e.getCode(), code)) {
                return e;
            }
        }
        return null;
    }


}
